var mongoose = require('mongoose')
var db = mongoose.createConnection('localhost', 'example1_test3')

db.on('error', console.error.bind(console, '连接错误:'))
db.once('open', function(){
    var PersonSchema = new mongoose.Schema({
        name: String
    })
    var PersonModel = db.model('Person', PersonSchema)
    var personEntity = new PersonModel({name: 'hahaha'})

    personEntity.save();

    PersonModel.find(function (err, persons) {
        console.log(persons)
    })
})